package com.huawei.appgallery.forum.cards.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.bean.PostTime;
import com.huawei.appgallery.forum.base.card.bean.User;
import com.huawei.appgallery.forum.cards.widget.UserInfoTextView.e;
import huawei.widget.HwTextView;
import o.azb;
import o.bsx;
import o.bsy;
import o.bsy.b;
import o.bsy.c;
import o.btc;
import o.btl;

public class PostUserContentView extends RelativeLayout implements e {
    private btl ʻ;
    private View ʽ;
    private ImageView ˊ;
    private HwTextView ˋ;
    private TextView ˎ;
    private Context ˏ;
    private UserInfoTextView ॱ;

    public void setUserContentClickLisenter(btl o_btl) {
        this.ʻ = o_btl;
    }

    public PostUserContentView(Context context) {
        super(context);
        ˎ(context);
    }

    public PostUserContentView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        ˎ(context);
    }

    public PostUserContentView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˎ(context);
    }

    private void ˎ(Context context) {
        this.ˏ = context;
        this.ʽ = ((LayoutInflater) context.getSystemService("layout_inflater")).inflate(b.ॱˋ, this);
        azb.ˏ(this.ʽ);
        this.ˊ = (ImageView) this.ʽ.findViewById(c.ˋʼ);
        this.ॱ = (UserInfoTextView) this.ʽ.findViewById(c.ˎͺ);
        this.ˎ = (TextView) this.ʽ.findViewById(c.ͺˏ);
        this.ˋ = (HwTextView) this.ʽ.findViewById(c.ˊʻ);
        this.ॱ.setFakeView(this.ˎ);
        this.ॱ.setUserFakeViewChangeListener(this);
        ˎ(this.ˊ);
        ˎ(this.ˎ);
        ॱ(this.ʽ);
    }

    public View getRootView() {
        return this.ʽ;
    }

    public void setData(User user, PostTime postTime) {
        if (user != null) {
            bsx.ˋ(this.ˏ, this.ˊ, user.ˎ());
            this.ॱ.setData(user);
            this.ॱ.setVisibility(0);
        } else {
            this.ॱ.setVisibility(8);
        }
        if (postTime != null) {
            this.ˋ.setText(btc.ˏ(this.ˏ, postTime));
            this.ˋ.setVisibility(0);
            return;
        }
        this.ˋ.setVisibility(8);
    }

    private void ˎ(View view) {
        if (view != null) {
            view.setOnClickListener(new 1(this));
        }
    }

    private void ॱ(View view) {
        if (view != null) {
            view.setOnClickListener(new 2(this));
        }
    }

    public void ˊ(int i) {
        this.ˎ.setWidth((getResources().getDimensionPixelSize(bsy.e.ˎˎ) + (getResources().getDimensionPixelSize(bsy.e.ʿ) * 2)) + i);
    }

    public void setUserNikeNameColer(int i) {
        this.ॱ.setUserNickNameColor(i);
    }

    public void setStampTextViewColor(int i) {
        this.ॱ.setStampTextViewColor(i);
    }

    public void setUserDutiesViewColor(int i) {
        this.ॱ.setUserDutiesViewColor(i);
    }

    public void setFakeViewColor(int i) {
        this.ॱ.setFakeViewColor(i);
    }

    public void setPostTimeViewColor(int i) {
        this.ˋ.setTextColor(i);
    }

    public void setNickNameFakeViewColor(int i) {
        this.ˎ.setTextColor(i);
    }
}
